//
//  ToolClass.h
//  SocketDemo
//
//  Created by apple on 17/2/24.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ToolClass : NSObject

+ (NSString*) createUUIDString;

+(UINavigationController *)getMainNavigationController;

+(UILabel *)creatLabelWithFrame:(CGRect)frame font:(CGFloat)font textColor:(UIColor *)textColor text:(NSString *)text;

+(UIViewController *)findViewControllerWithCurrentView:(UIView *)currentView;

+(CGFloat)widthOfString:(NSString *)string font:(UIFont *)font height:(CGFloat)height;

+(UIButton *)createButtonWithFrame:(CGRect)frame text:(NSString *)text textColor:(UIColor *)textColor imageName:(NSString *)imageName font:(CGFloat)font;

+(UITextField *)createSearchTextFieldWithFrame:(CGRect)frame placeholder:(NSString *)placeholder;

//上下结构的button
+(UIButton *)createUpDownButtonWithFrame:(CGRect)frame text:(NSString *)text textColor:(UIColor *)textColor imageName:(NSString *)imageName font:(CGFloat)font imageSize:(CGFloat)imageSize theInterval:(CGFloat)theInterval;
//上下结构的button  字体粗
+(UIButton *)createUpDownButtonWithFrame:(CGRect)frame text:(NSString *)text textColor:(UIColor *)textColor imageName:(NSString *)imageName font:(CGFloat)font isBoldSystem:(BOOL)isBoldSystem imageSize:(CGFloat)imageSize theInterval:(CGFloat)theInterval ;
+(UIButton *)zj_createUpDownButtonWithFrame:(CGRect)frame text:(NSString *)text textColor:(UIColor *)textColor imageName:(NSString *)imageName font:(CGFloat)font isBoldSystem:(BOOL)isBoldSystem imageSize:(CGFloat)imageSize theInterval:(CGFloat)theInterval ;
+(UIImageView *)createRadiusImageViewWirhFrame:(CGRect)frame;

+(UITabBarController *)getMainTabBarViewController;

+ (NSString *)iphoneType;

+(NSString *)getChineseStringByNumber:(NSNumber *)number;

+(NSDictionary *)getDictionaryFromJsonString:(NSString *)jsonString;

+(NSString *)getjsonStringFromDictionary:(NSDictionary *)dic;


+(NSData *)getDataFromDictionary:(NSDictionary *)dic;


+(void)cleanCacheAndCookie;

+(UITextField *)createTextFieldWithFrame:(CGRect)frame placeholder:(NSString *)placeholder;

+(UIButton *)createSystemButtonWithOriginY:(CGFloat)originY text:(NSString *)text;

+(UIButton *)createSystemBoraderButtonWithFrame:(CGRect)frame text:(NSString *)text;

+(UIButton *)createButtonWithFrame:(CGRect)frame text:(NSString *)text textColor:(UIColor *)textColor imageName:(NSString *)imageName font:(CGFloat)font imageSize:(CGFloat)imageSize;

+ (BOOL)openMessageNotificationService;

+ (BOOL)openLocationService;

//邮箱
+ (BOOL) justEmail:(NSString *)email;

//手机号码验证
+ (BOOL) justMobile:(NSString *)mobile;

//车牌号验证
+ (BOOL) justCarNo:(NSString *)carNo;

//车型
+ (BOOL) justCarType:(NSString *)CarType;

//用户名
+ (BOOL) justUserName:(NSString *)name;

//密码
+ (BOOL) justPassword:(NSString *)passWord;

//昵称
+ (BOOL) justNickname:(NSString *)nickname;

//身份证号
+ (BOOL) justIdentityCard: (NSString *)identityCard;

//获取版本号
+(NSString *)getCurrentVersion;

+(NSString *)getjsonStringFromArray:(NSArray *)array;

//压缩图片至多少b
+(NSData *)compressionImageWithImage:(UIImage *)image compressionMaxLimit:(CGFloat)compressionMaxLimit;

+(NSURL *)ybFilterImageUrlWithUrl:(NSURL *)url;
//获取YBPopupMenu宽度
+(CGFloat)YBPopupMenuGetTitleWidthByTitleArray:(NSArray *)titleArray;
//获取指定大小图片
+ (UIImage*)transformImageSizeWithImage:(UIImage *)image width:(CGFloat)width height:(CGFloat)height;

//计算UILabel的高度(带有行间距的情况)
+(CGFloat)getSpaceLabelHeight:(NSString*)str withFont:(float)font withWidth:(CGFloat)width WithSpace:(float)space;

//设置后台播放信息
+(void)setBackPlayInfoWithTitle:(NSString *)title singer:(NSString *)singer imageName:(NSString *)imageName totalTime:(CGFloat)totalTime alreadyTime:(CGFloat)alreadyTime;

//添加下划线
+(void)addUnderLineWithSuperView:(UIView *)superView leftSpace:(CGFloat)leftSpace rightSpace:(CGFloat)rightSpace;
@end
